<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            button{
                background-color: #fff;
                border: 1px solid #000;
                border-radius: 5px;
                padding: 5px 10px;
                cursor: pointer;
                transition: all .5s;
            }
            /* pc端 鼠标移入和点击样式 */
            button:hover{
                background-color: #000;
                color: #fff;
            }
            /*  移动端 鼠标按下样式 */
            button:active{
                background-color: #fff;
                color: #000;
            }
        </style>
    </head>
 <body>
    <button>点击了按钮</button>
</body>

</html>